package com.ruoyi.activity.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.activity.mapper.WorkinformationMapper;
import com.ruoyi.activity.model.domain.Workinformation;
import com.ruoyi.activity.service.IWorkinformationService;

/**
 * 参赛信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-29
 */
@Service
public class WorkinformationServiceImpl implements IWorkinformationService 
{
    @Autowired
    private WorkinformationMapper workinformationMapper;

    /**
     * 查询参赛信息
     * 
     * @param id 参赛信息主键
     * @return 参赛信息
     */
    @Override
    public Workinformation selectWorkinformationById(Long id)
    {
        return workinformationMapper.selectWorkinformationById(id);
    }

    /**
     * 查询参赛信息列表
     * 
     * @param workinformation 参赛信息
     * @return 参赛信息
     */
    @Override
    public List<Workinformation> selectWorkinformationList(Workinformation workinformation)
    {
        return workinformationMapper.selectWorkinformationList(workinformation);
    }

    /**
     * 新增参赛信息
     * 
     * @param workinformation 参赛信息
     * @return 结果
     */
    @Override
    public int insertWorkinformation(Workinformation workinformation)
    {
        workinformation.setCreateTime(DateUtils.getNowDate());
        return workinformationMapper.insertWorkinformation(workinformation);
    }

    /**
     * 修改参赛信息
     * 
     * @param workinformation 参赛信息
     * @return 结果
     */
    @Override
    public int updateWorkinformation(Workinformation workinformation)
    {
        workinformation.setUpdateTime(DateUtils.getNowDate());
        return workinformationMapper.updateWorkinformation(workinformation);
    }

    /**
     * 批量删除参赛信息
     * 
     * @param ids 需要删除的参赛信息主键
     * @return 结果
     */
    @Override
    public int deleteWorkinformationByIds(Long[] ids)
    {
        return workinformationMapper.deleteWorkinformationByIds(ids);
    }

    /**
     * 删除参赛信息信息
     * 
     * @param id 参赛信息主键
     * @return 结果
     */
    @Override
    public int deleteWorkinformationById(Long id)
    {
        return workinformationMapper.deleteWorkinformationById(id);
    }
}
